﻿using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Suntront.DatabaseAccessor;

using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using AspNetCoreMvcPrj.Models;
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;

namespace AspNetCoreMvcPrj
{
    [AppDbContext("DMConnectionString", DbProvider.Dm)]
    public class DMDbContext : AppDbContext<DMDbContext>
    {
        public DMDbContext(DbContextOptions<DMDbContext> options) : base(options)
        {

          

        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            /*
            modelBuilder.Entity<BW_WorkFlowManage>()
     .Property(e => e.remark).IsRequired(false).HasColumnType("VARCHAR(40)").IsUnicode(false);
            */
            
            base.OnModelCreating(modelBuilder);
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
          //  optionsBuilder.AddInterceptors(new DamengNullInterceptor());
            //   optionsBuilder.UseDm("Server=32.168.82.8;Port=5236;Uid=XT_ZHSW_BIAOWU;Pwd=Xtkj300259");
            base.OnConfiguring(optionsBuilder);
        }

    }
}
